package com.wuhan.template.module.wode.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.View;

import java.util.List;

/**
 * Created by Administrator on 2016/5/14 0014.
 */
public class CollectPageAdapter extends FragmentPagerAdapter{

    private Context context;
    private  List<Fragment> fragments;

    public CollectPageAdapter(FragmentManager fm, Context context, List<Fragment> fragments) {
        super(fm);
        this.context = context;
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==object;
    }

    private String titles[]={"文章收藏","图片收藏","视频收藏"};
    @Override
    public CharSequence getPageTitle(int position) {

        return titles[position];
    }
}
